<%@ page import="com.share.entity.Blog" %>
<%@ page import="java.util.List" %>
<%@ page import="com.share.entity.Comment" %>
<%--
  Created by IntelliJ IDEA.
  User: leeping
  Date: 2016/1/12
  Time: 21:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>评论</title>
</head>
<body>
<% if (request.getAttribute("msg") != null) {%><h1><%=request.getAttribute("msg")%>
</h1><%}%>

<% Blog blog = (Blog) request.getAttribute("blog");%>
<p><span>内容:<%=blog.getContent()%></span>&nbsp;&nbsp; <span>时间:<%=blog.getCreateTime()%></span>
</p>
<% List<Comment> comments = (List<Comment>) request.getAttribute("comments");
	if (comments.size() > 0) {
%>
<h1>评论</h1>
<%
	for (Comment comment : comments) {
%>
<p><span>内容:<%=comment.getContent()%></span>&nbsp;&nbsp; <span>时间:<%=blog.getCreateTime()%></span>
</p>
<% }
}%>
<form action="/comment/add" method="post">
	评论：<textarea name="content"></textarea>
	<input name="blogId" value="<%=blog.getId()%>" style="display: none">
	<input value="评论" type="submit">
</form>
<a href="/index">列表</a>
</body>
</html>
